&ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI adm2
&ANALYZE-RESUME
&Scoped-define WINDOW-NAME CURRENT-WINDOW


/* Temp-Table and Buffer definitions                                    */
DEFINE TEMP-TABLE ab_unmap
       FIELD alang AS CHARACTER FORMAT "X(256)":U 
       FIELD aucun_art AS CHARACTER FORMAT "X(256)":U 
       FIELD crit AS CHARACTER FORMAT "X(256)":U 
       FIELD entete AS CHARACTER FORMAT "X(256)":U 
       FIELD FRowid AS CHARACTER FORMAT "X(256)":U 
       FIELD ident AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-lang AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-libel AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-stat1 AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-stat2 AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-stat3 AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-stat4 AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-type AS CHARACTER FORMAT "X(256)":U 
       FIELD langue AS CHARACTER 
       FIELD ligne AS CHARACTER FORMAT "X(256)":U 
       FIELD LRowid AS CHARACTER FORMAT "X(256)":U 
       FIELD LstProd AS CHARACTER FORMAT "X(12000)":U 
       FIELD Lsttypex AS CHARACTER FORMAT "X(2000)":U 
       FIELD navigation AS CHARACTER FORMAT "X(256)":U 
       FIELD recherche AS CHARACTER FORMAT "X(256)":U 
       FIELD statq AS CHARACTER 
       FIELD texte1 AS CHARACTER FORMAT "X(256)":U 
       FIELD texte2 AS CHARACTER FORMAT "X(256)":U 
       FIELD texte3 AS CHARACTER FORMAT "X(256)":U 
       FIELD Tprod AS CHARACTER 
       FIELD TypeInt AS CHARACTER FORMAT "X(256)":U .



&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS w-html 
/*------------------------------------------------------------------------

  File: 

  Description: 

  Input Parameters:
      <none>

  Output Parameters:
      <none>

  Author: 

  Created: 

------------------------------------------------------------------------*/
/*           This .W file was created with AppBuilder.                  */
/*----------------------------------------------------------------------*/

/* Create an unnamed pool to store all the widgets created 
     by this procedure. This is a good default which assures
     that this procedure's triggers and internal procedures 
     will execute in this procedure's storage, and that proper
     cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.

/* ***************************  Definitions  ************************** */

/* Preprocessor Definitions ---                                         */

/* Parameters Definitions ---                                           */

/* Local Variable Definitions ---                                       */


DEF VAR wcoul-colp      AS CHARACTER                 NO-UNDO.
DEF VAR wcoul-coli      AS CHARACTER                 NO-UNDO.

DEF VAR tab-lib         AS CHARACTER EXTENT 10       NO-UNDO.
DEF VAR lib-rec         AS CHARACTER                 NO-UNDO.
DEF VAR lib-type        AS CHARACTER                 NO-UNDO.
DEF VAR lib-lang        AS CHARACTER                 NO-UNDO.
DEF VAR lib-stat        AS CHARACTER                 NO-UNDO.

DEF VAR i               AS INTEGER                   NO-UNDO.
DEF VAR j               AS INTEGER                   NO-UNDO.
DEF VAR nb-record       AS INTEGER                   NO-UNDO.

DEF VAR lst-cahier      AS CHARACTER                 NO-UNDO.
DEF VAR lst-prod1       AS CHARACTER                 NO-UNDO.
DEF VAR lst-prod2       AS CHARACTER                 NO-UNDO.
DEF VAR lst-lang1       AS CHARACTER                 NO-UNDO.
DEF VAR lst-lang2       AS CHARACTER                 NO-UNDO.

DEF VAR f-labind        AS CHARACTER                 NO-UNDO.
DEF VAR f-labindf       AS CHARACTER                 NO-UNDO.
DEF VAR f-labinda       AS CHARACTER                 NO-UNDO.

DEF VAR f-labtous       AS CHARACTER                 NO-UNDO.
DEF VAR f-labtousf      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtousa      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtcah       AS CHARACTER                 NO-UNDO.
DEF VAR f-labtcahf      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtcaha      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtmar       AS CHARACTER                 NO-UNDO.
DEF VAR f-labtmarf      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtmara      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtact       AS CHARACTER                 NO-UNDO.
DEF VAR f-labtactf      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtacta      AS CHARACTER                 NO-UNDO.
DEF VAR contenu-ligne   AS CHARACTER  EXTENT 10      NO-UNDO.
DEF VAR lien-ligne      AS CHARACTER  EXTENT 10      NO-UNDO.
DEF VAR action          AS CHARACTER                 NO-UNDO.

DEF VAR flag-aff        AS LOGICAL                   NO-UNDO.
DEF VAR flag-libraire   AS LOGICAL                   NO-UNDO.
DEF VAR flag-tous       AS LOGICAL                   NO-UNDO.
DEF VAR lst-hors        AS CHARACTER                 NO-UNDO.

DEF VAR lab-rec         AS CHARACTER  INIT "Lib rec" NO-UNDO.
DEF VAR a-lang          AS INTEGER                   NO-UNDO.
DEF VAR lab-bouton      AS CHARACTER EXTENT 5        NO-UNDO.

DEF VAR flag-int        AS LOGICAL                   NO-UNDO.
DEF VAR flag-ou         AS LOGICAL                   NO-UNDO.

DEF VAR buf-nocli       AS INTEGER                   NO-UNDO.

DEF VAR lst-etat        AS CHARACTER INIT "OOOO"     NO-UNDO.
DEF VAR l-rowid         AS ROWID                     NO-UNDO.
DEF VAR f-rowid         AS ROWID                     NO-UNDO.


DEFINE VARIABLE qh AS WIDGET-HANDLE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK 

/* ********************  Preprocessor Definitions  ******************** */

&Scoped-define PROCEDURE-TYPE Web-Object
&Scoped-define DB-AWARE no

&Scoped-define WEB-FILE tbr_nouveautes.htm

/* Name of designated FRAME-NAME and/or first browse and/or first query */
&Scoped-define FRAME-NAME Web-Frame

/* Standard List Definitions                                            */
&Scoped-Define ENABLED-OBJECTS ab_unmap.texte1 ab_unmap.texte2 ~
ab_unmap.texte3 ab_unmap.aucun_art ab_unmap.ident ab_unmap.alang ~
ab_unmap.entete ab_unmap.ligne ab_unmap.statq ab_unmap.lab-stat1 ~
ab_unmap.lab-stat2 ab_unmap.lab-stat3 ab_unmap.lab-stat4 ab_unmap.lab-lang ~
ab_unmap.langue ab_unmap.Lsttypex ab_unmap.LstProd ab_unmap.lab-libel ~
ab_unmap.TypeInt ab_unmap.lab-type ab_unmap.Tprod ab_unmap.FRowid ~
ab_unmap.crit ab_unmap.LRowid ab_unmap.navigation ab_unmap.recherche 
&Scoped-Define DISPLAYED-OBJECTS ab_unmap.texte1 ab_unmap.texte2 ~
ab_unmap.texte3 ab_unmap.aucun_art ab_unmap.ident ab_unmap.alang ~
ab_unmap.entete ab_unmap.ligne ab_unmap.statq ab_unmap.lab-stat1 ~
ab_unmap.lab-stat2 ab_unmap.lab-stat3 ab_unmap.lab-stat4 ab_unmap.lab-lang ~
ab_unmap.langue ab_unmap.Lsttypex ab_unmap.LstProd ab_unmap.lab-libel ~
ab_unmap.TypeInt ab_unmap.lab-type ab_unmap.Tprod ab_unmap.FRowid ~
ab_unmap.crit ab_unmap.LRowid ab_unmap.navigation ab_unmap.recherche 

/* Custom List Definitions                                              */
/* List-1,List-2,List-3,List-4,List-5,List-6                            */

/* _UIB-PREPROCESSOR-BLOCK-END */
&ANALYZE-RESUME


/* ************************  Function Prototypes ********************** */

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD charge_ligne w-html 
FUNCTION charge_ligne RETURNS CHARACTER
  ( /* parameter-definitions */ )  FORWARD.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


/* ***********************  Control Definitions  ********************** */


/* Definitions of the field level widgets                               */

/* ************************  Frame Definitions  *********************** */

DEFINE FRAME Web-Frame
     ab_unmap.texte1 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte2 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte3 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.aucun_art AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.ident AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.alang AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.entete AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.ligne AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.statq AT ROW 1 COL 1 HELP
          "" NO-LABEL
          VIEW-AS RADIO-SET VERTICAL
          RADIO-BUTTONS 
                    "statq 1", "",
"statq 2", "N":U,
"statq 3", "P":U,
"statq 4", "L":U
          SIZE 20 BY 5
     ab_unmap.lab-stat1 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab-stat2 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab-stat3 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab-stat4 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab-lang AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.langue AT ROW 1 COL 1 HELP
          "" NO-LABEL
          VIEW-AS SELECTION-LIST SINGLE NO-DRAG 
          SIZE 20 BY 4
     ab_unmap.Lsttypex AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(2000)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.LstProd AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(12000)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab-libel AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.TypeInt AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab-type AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.Tprod AT ROW 1 COL 1 HELP
          "" NO-LABEL
          VIEW-AS SELECTION-LIST SINGLE NO-DRAG 
          SIZE 20 BY 4
     ab_unmap.FRowid AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.crit AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.LRowid AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
    WITH 1 DOWN KEEP-TAB-ORDER OVERLAY 
         SIDE-LABELS 
         AT COL 1 ROW 1
         SIZE 60.38 BY 14.13.

/* DEFINE FRAME statement is approaching 4K Bytes.  Breaking it up   */
DEFINE FRAME Web-Frame
     ab_unmap.navigation AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.recherche AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
    WITH 1 DOWN KEEP-TAB-ORDER OVERLAY 
         SIDE-LABELS 
         AT COL 1 ROW 1
         SIZE 60.38 BY 14.13.


/* *********************** Procedure Settings ************************ */

&ANALYZE-SUSPEND _PROCEDURE-SETTINGS
/* Settings for THIS-PROCEDURE
   Type: Web-Object
   Allow: Query
   Frames: 1
   Add Fields to: Neither
   Editing: Special-Events-Only
   Events: web.output,web.input
   Other Settings: COMPILE
   Temp-Tables and Buffers:
      TABLE: ab_unmap W "?" ?  
      ADDITIONAL-FIELDS:
          FIELD alang AS CHARACTER FORMAT "X(256)":U 
          FIELD aucun_art AS CHARACTER FORMAT "X(256)":U 
          FIELD crit AS CHARACTER FORMAT "X(256)":U 
          FIELD entete AS CHARACTER FORMAT "X(256)":U 
          FIELD FRowid AS CHARACTER FORMAT "X(256)":U 
          FIELD ident AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-lang AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-libel AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-stat1 AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-stat2 AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-stat3 AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-stat4 AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-type AS CHARACTER FORMAT "X(256)":U 
          FIELD langue AS CHARACTER 
          FIELD ligne AS CHARACTER FORMAT "X(256)":U 
          FIELD LRowid AS CHARACTER FORMAT "X(256)":U 
          FIELD LstProd AS CHARACTER FORMAT "X(12000)":U 
          FIELD Lsttypex AS CHARACTER FORMAT "X(2000)":U 
          FIELD navigation AS CHARACTER FORMAT "X(256)":U 
          FIELD recherche AS CHARACTER FORMAT "X(256)":U 
          FIELD statq AS CHARACTER 
          FIELD texte1 AS CHARACTER FORMAT "X(256)":U 
          FIELD texte2 AS CHARACTER FORMAT "X(256)":U 
          FIELD texte3 AS CHARACTER FORMAT "X(256)":U 
          FIELD Tprod AS CHARACTER 
          FIELD TypeInt AS CHARACTER FORMAT "X(256)":U 
      END-FIELDS.
   END-TABLES.
 */
&ANALYZE-RESUME _END-PROCEDURE-SETTINGS

/* *************************  Create Window  ************************** */

&ANALYZE-SUSPEND _CREATE-WINDOW
/* DESIGN Window definition (used by the UIB) 
  CREATE WINDOW w-html ASSIGN
         HEIGHT             = 14.13
         WIDTH              = 60.38.
/* END WINDOW DEFINITION */
                                                                        */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB w-html 
/* *********************** Included-Libraries ************************* */

{src/web2/html-map.i}

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME




/* ***********  Runtime Attributes and AppBuilder Settings  *********** */

&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
/* SETTINGS FOR WINDOW w-html
  VISIBLE,,RUN-PERSISTENT                                               */
/* SETTINGS FOR FRAME Web-Frame
   FRAME-NAME UNDERLINE                                                 */
/* SETTINGS FOR FILL-IN ab_unmap.alang IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.aucun_art IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.crit IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.entete IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.FRowid IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.ident IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-lang IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-libel IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-stat1 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-stat2 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-stat3 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-stat4 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-type IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR SELECTION-LIST ab_unmap.langue IN FRAME Web-Frame
   EXP-LABEL EXP-FORMAT EXP-HELP                                        */
/* SETTINGS FOR FILL-IN ab_unmap.ligne IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.LRowid IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.LstProd IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.Lsttypex IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.navigation IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.recherche IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR RADIO-SET ab_unmap.statq IN FRAME Web-Frame
   EXP-LABEL EXP-FORMAT EXP-HELP                                        */
/* SETTINGS FOR FILL-IN ab_unmap.texte1 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte2 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte3 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR SELECTION-LIST ab_unmap.Tprod IN FRAME Web-Frame
   EXP-LABEL EXP-FORMAT EXP-HELP                                        */
/* SETTINGS FOR FILL-IN ab_unmap.TypeInt IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* _RUN-TIME-ATTRIBUTES-END */
&ANALYZE-RESUME

 



/* ************************  Control Triggers  ************************ */

&Scoped-define SELF-NAME ab_unmap.aucun_art
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.aucun_art w-html WEB.output
PROCEDURE ab_unmap.aucun_art.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     IF NOT flag-aff THEN DO:
         FIND erreur WHERE erreur.noerr = 100080
                       AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
         {&out} erreur.libel.
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.entete
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.entete w-html WEB.output
PROCEDURE ab_unmap.entete.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR nom_page        AS CHARACTER      NO-UNDO.
  DEF VAR ligne           AS CHARACTER      NO-UNDO.
  DEF VAR lst-tag         AS CHARACTER      NO-UNDO.
  DEF VAR pos             AS INTEGER        NO-UNDO.

  DO WITH FRAME {&FRAME-NAME}:
     
     IF contenu-ligne[1] = "" THEN RETURN.
     FIND erreur WHERE erreur.noerr = 101028
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.

     nom_page = SEARCH("tbr_nouveautes_entete.htm").
     IF nom_page = ? THEN RETURN.
     INPUT FROM VALUE(nom_page).
     REPEAT:
        IMPORT UNFORMATTED ligne.
        pos = INDEX(ligne,"<!--WSTAG").
        IF TRIM(ligne) BEGINS "<!--" AND pos = 0 THEN NEXT.
        IF pos = 0 THEN {&out} ligne SKIP.
        ELSE DO:
           RUN decode_tag(ligne,"label",OUTPUT lst-tag).
           DO i = 1 TO NUM-ENTRIES(lst-tag).
              RUN remplace_tag ("label",3,ENTRY(i,lst-tag),erreur.libel,INPUT-OUTPUT ligne).
           END.
           {&out} ligne SKIP.
        END.
     END.

  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.ident
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.ident w-html WEB.output
PROCEDURE ab_unmap.ident.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     IF buf-nocli <> 0    AND  buf-nocli <> 1001 AND
        buf-nocli <> 1001 THEN DO:
        FIND erreur WHERE erreur.noerr = 101056
                       AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
        {&out} erreur.libel  " : " buf-nocli " / ".

        FIND adra WHERE adra.nosoc = 1
                    AND adra.noadr = buf-nocli
                    AND adra.csmt  = 0 NO-LOCK NO-ERROR.
        IF AVAILABLE adra THEN {&out} adra.nom.
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-lang
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-lang w-html WEB.output
PROCEDURE ab_unmap.lab-lang.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     FIND erreur WHERE erreur.noerr = 101029
                   AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
     {&out} erreur.libel.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-libel
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-libel w-html WEB.output
PROCEDURE ab_unmap.lab-libel.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     FIND erreur WHERE erreur.noerr = 101006
                   AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
     {&out} erreur.libel.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-stat1
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-stat1 w-html WEB.output
PROCEDURE ab_unmap.lab-stat1.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:

     FIND erreur WHERE erreur.noerr = 101043
                   AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
     {&out} ENTRY(1,erreur.libel).
  
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-stat2
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-stat2 w-html WEB.output
PROCEDURE ab_unmap.lab-stat2.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     FIND erreur WHERE erreur.noerr = 101043
                   AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
     {&out} ENTRY(2,erreur.libel).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-stat3
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-stat3 w-html WEB.output
PROCEDURE ab_unmap.lab-stat3.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     FIND erreur WHERE erreur.noerr = 101043
                   AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
     {&out} ENTRY(3,erreur.libel).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-stat4
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-stat4 w-html WEB.output
PROCEDURE ab_unmap.lab-stat4.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     FIND erreur WHERE erreur.noerr = 101043
                   AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
     {&out} ENTRY(4,erreur.libel).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-type
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-type w-html WEB.output
PROCEDURE ab_unmap.lab-type.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     FIND erreur WHERE erreur.noerr = 101007
                   AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
     {&out} erreur.libel.
  END.

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.ligne
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.ligne w-html WEB.output
PROCEDURE ab_unmap.ligne.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR nom_page        AS CHARACTER      NO-UNDO.
  DEF VAR ligne           AS CHARACTER      NO-UNDO.
  DEF VAR lst-tag         AS CHARACTER      NO-UNDO.
  DEF VAR pos             AS INTEGER        NO-UNDO.
  DEF VAR i               AS INTEGER        NO-UNDO.
  DEF VAR num             AS INTEGER        NO-UNDO.

  DO WITH FRAME {&FRAME-NAME}:
     DO num = 1 TO max(INTEGER(get-field("Nbligne")),10):
        
        IF contenu-ligne[num] = "" THEN NEXT.
        flag-aff = TRUE.
        nom_page = SEARCH("tbr_nouveautes_ligne.htm").
        IF nom_page = ? THEN RETURN.
        INPUT FROM VALUE(nom_page).
        REPEAT:
           IMPORT UNFORMATTED ligne.
           pos = INDEX(ligne,"<!--WSTAG").
           IF TRIM(ligne) BEGINS "<!--" AND pos = 0 THEN NEXT.
           IF pos = 0 THEN {&out} ligne SKIP.
           ELSE DO:
              RUN decode_tag(ligne,"champ",OUTPUT lst-tag).
              DO i = 1 TO NUM-ENTRIES(lst-tag).
                 RUN remplace_tag ("champ",10,ENTRY(i,lst-tag),contenu-ligne[num],INPUT-OUTPUT ligne).
              END.
              {&out} ligne SKIP.
           END.
        END.
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.navigation
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.navigation w-html WEB.output
PROCEDURE ab_unmap.navigation.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  IF flag-aff THEN RUN navigue2.p (100019,a-lang,lst-etat).
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.recherche
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.recherche w-html WEB.output
PROCEDURE ab_unmap.recherche.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  RUN recherche.p (a-lang).
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte1
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte1 w-html WEB.output
PROCEDURE ab_unmap.texte1.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN affiche_texte(101110,"tbr_nouveautes_texte1.htm").
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte2
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte2 w-html WEB.output
PROCEDURE ab_unmap.texte2.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN affiche_texte(101111,"tbr_nouveautes_texte2.htm").
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte3
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte3 w-html WEB.output
PROCEDURE ab_unmap.texte3.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      RUN affiche_texte(101112,"tbr_nouveautes_texte3.htm").
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&UNDEFINE SELF-NAME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK w-html 


/* ************************  Main Code Block  ************************* */

/* Standard Main Block that runs adm-create-objects, initializeObject 
 * and process-web-request.
 * The bulk of the web processing is in the Procedure process-web-request
 * elsewhere in this Web object.
 */
{src/web2/template/hmapmain.i}

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


/* **********************  Internal Procedures  *********************** */

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects w-html  _ADM-CREATE-OBJECTS
PROCEDURE adm-create-objects :
/*------------------------------------------------------------------------------
  Purpose:     Create handles for all SmartObjects used in this procedure.
               After SmartObjects are initialized, then SmartLinks are added.
  Parameters:  <none>
------------------------------------------------------------------------------*/

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE affiche_texte w-html 
PROCEDURE affiche_texte :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

  DEF INPUT PARAMETER par-noerr      AS     INTEGER.
  DEF INPUT PARAMETER par-nompage    AS     CHARACTER.


  DEF VAR nom_page        AS CHARACTER      NO-UNDO.
  DEF VAR ligne           AS CHARACTER      NO-UNDO.
  DEF VAR lst-tag         AS CHARACTER      NO-UNDO.
  DEF VAR pos             AS INTEGER        NO-UNDO.

  DO WITH FRAME {&FRAME-NAME}:
     IF contenu-ligne[1] = "" THEN RETURN.
     FIND erreur WHERE erreur.noerr = par-noerr
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.

     nom_page = SEARCH(par-nompage).
     IF nom_page = ? THEN RETURN.
     INPUT FROM VALUE(nom_page).
     REPEAT:
        IMPORT UNFORMATTED ligne.
        pos = INDEX(ligne,"<!--WSTAG").
        IF TRIM(ligne) BEGINS "<!--" AND pos = 0 THEN NEXT.
        IF pos = 0 THEN {&out} ligne SKIP.
        ELSE DO:
           RUN decode_tag(ligne,"texte",OUTPUT lst-tag).
           DO i = 1 TO NUM-ENTRIES(lst-tag).
              RUN remplace_tag ("texte",3,ENTRY(i,lst-tag),erreur.libel,INPUT-OUTPUT ligne).
           END.
           {&out} ligne SKIP.
        END.
     END.

  END.
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE creation_lstprod w-html 
PROCEDURE creation_lstprod :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

/* Construction de la liste de type de produit en fonction du cahier */

FOR EACH atyp WHERE atyp.lang = a-lang
                AND atyp.TYPE BEGINS "WEB" NO-LOCK:
/*     FIND FIRST arti WHERE arti.nosoc = 1                            */
/*                       AND arti.pub   = TRUE                         */
/*                       AND arti.TYPE  = atyp.TYPE NO-LOCK NO-ERROR.  */
/*     IF NOT AVAILABLE arti THEN NEXT.                                */
    tprod:ADD-LAST(TRIM(atyp.libel[1] + " " + atyp.libel[2])) IN FRAME {&FRAME-NAME}.
    lst-prod1 = lst-prod1 + "," + atyp.TYPE.
END.
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE decode_tag w-html 
PROCEDURE decode_tag :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

DEF INPUT  PARAMETER ligne    AS CHARACTER           NO-UNDO.
DEF INPUT  PARAMETER ancre    AS CHARACTER           NO-UNDO.
DEF OUTPUT PARAMETER lst-tag  AS CHARACTER           NO-UNDO.

DEF VAR i              AS INTEGER           NO-UNDO.
DEF VAR j              AS INTEGER           NO-UNDO.
DEF VAR pos            AS INTEGER           NO-UNDO.
DEF VAR tag            AS CHARACTER         NO-UNDO.


  REPEAT:
     i = INDEX(ligne,"<!--").
     j = IF INDEX(ligne,"-->") <> 0 THEN INDEX(ligne,"-->") + 2 ELSE LENGTH(ligne).
     IF i = 0 THEN LEAVE.
     tag = SUBSTRING(ligne,i,j - i + 1).
     pos = INDEX(tag,"<!--WSTAG").
     IF pos <> 0 THEN DO:
        pos = INDEX(tag,ancre).
        IF pos <> 0 AND LOOKUP(tag,lst-tag) = 0 THEN lst-tag = lst-tag + "," + tag.
     END.
     ligne = SUBSTRING(ligne,j + 1).
  END.
  lst-tag = SUBSTRING(lst-tag,2).
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE htmOffsets w-html  _WEB-HTM-OFFSETS
PROCEDURE htmOffsets :
/*------------------------------------------------------------------------------
  Purpose:     Runs procedure to associate each HTML field with its
               corresponding widget name and handle.
  Parameters:  
  Notes:       
------------------------------------------------------------------------------*/
  RUN readOffsets ("{&WEB-FILE}":U).
  RUN htmAssociate
    ("aucun_art":U,"ab_unmap.aucun_art":U,ab_unmap.aucun_art:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("entete":U,"ab_unmap.entete":U,ab_unmap.entete:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("FRowid":U,"ab_unmap.FRowid":U,ab_unmap.FRowid:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("ident":U,"ab_unmap.ident":U,ab_unmap.ident:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-lang":U,"ab_unmap.lab-lang":U,ab_unmap.lab-lang:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-libel":U,"ab_unmap.lab-libel":U,ab_unmap.lab-libel:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-stat1":U,"ab_unmap.lab-stat1":U,ab_unmap.lab-stat1:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-stat2":U,"ab_unmap.lab-stat2":U,ab_unmap.lab-stat2:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-stat3":U,"ab_unmap.lab-stat3":U,ab_unmap.lab-stat3:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-stat4":U,"ab_unmap.lab-stat4":U,ab_unmap.lab-stat4:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-type":U,"ab_unmap.lab-type":U,ab_unmap.lab-type:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lang":U,"ab_unmap.alang":U,ab_unmap.alang:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("langue":U,"ab_unmap.langue":U,ab_unmap.langue:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lib":U,"ab_unmap.crit":U,ab_unmap.crit:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("ligne":U,"ab_unmap.ligne":U,ab_unmap.ligne:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("LRowid":U,"ab_unmap.LRowid":U,ab_unmap.LRowid:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("LstProd":U,"ab_unmap.LstProd":U,ab_unmap.LstProd:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("Lsttypex":U,"ab_unmap.Lsttypex":U,ab_unmap.Lsttypex:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("navigation":U,"ab_unmap.navigation":U,ab_unmap.navigation:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("recherche":U,"ab_unmap.recherche":U,ab_unmap.recherche:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("statq":U,"ab_unmap.statq":U,ab_unmap.statq:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte1":U,"ab_unmap.texte1":U,ab_unmap.texte1:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte2":U,"ab_unmap.texte2":U,ab_unmap.texte2:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte3":U,"ab_unmap.texte3":U,ab_unmap.texte3:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("Tprod":U,"ab_unmap.Tprod":U,ab_unmap.Tprod:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("TypeInt":U,"ab_unmap.TypeInt":U,ab_unmap.TypeInt:HANDLE IN FRAME {&FRAME-NAME}).
END PROCEDURE.


/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initialisation w-html 
PROCEDURE initialisation :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/
   DEF VAR flag-marq        AS      LOGICAL     NO-UNDO.


   a-lang = INTEGER(get-field("lang")).
   
   IF a-lang = 0 THEN a-lang = 2.

   DO WITH FRAME {&FRAME-NAME}:
      
      tprod:DELIMITER = "#".

      FOR EACH atyp WHERE atyp.lang = a-lang
                      AND atyp.TYPE BEGINS "WEB" NO-LOCK:
/*           FIND FIRST arti WHERE arti.nosoc = 1                            */
/*                             AND arti.pub   = TRUE                         */
/*                             AND arti.TYPE  = atyp.TYPE NO-LOCK NO-ERROR.  */
/*           IF NOT AVAILABLE arti THEN NEXT.                                */
          Lst-Prod1 = lst-prod1 + "#" + TRIM(atyp.libel[1] + " " + atyp.libel[2]).
          Lst-Prod2 = lst-prod2 + "#" + TRIM(atyp.TYPE).
          tprod:ADD-LAST(TRIM(atyp.libel[1] + " " + atyp.libel[2])).
      END.

      FIND erreur WHERE erreur.noerr = 101005
                    AND erreur.lang  = 2 NO-LOCK NO-ERROR.
      f-labtousf = erreur.libel.
      FIND erreur WHERE erreur.noerr = 101005
                    AND erreur.lang  = 1 NO-LOCK NO-ERROR.
      f-labtousa = erreur.libel.

      FIND erreur WHERE erreur.noerr = 101005
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      ASSIGN f-labtous = erreur.libel
             Lst-Prod1 = f-labtous + lst-Prod1.
      tprod:ADD-FIRST(f-labtous).

      FOR EACH parmt WHERE parmt.nosoc  = 0
                       AND parmt.nomuti = ""
                       AND parmt.nompar BEGINS "LANGUE" NO-LOCK:
          Lst-lang1 = lst-lang1 + "," + ENTRY(a-lang,parmt.valpar).
          Lst-lang2 = lst-lang2 + "," + ENTRY(3,parmt.valpar).
          langue:ADD-LAST(TRIM(ENTRY(a-lang,parmt.valpar))).
      END.

      FIND erreur WHERE erreur.noerr = 101030
                    AND erreur.lang  = 2 NO-LOCK NO-ERROR.
      f-labindf = erreur.libel.
      FIND erreur WHERE erreur.noerr = 101030
                    AND erreur.lang  = 1 NO-LOCK NO-ERROR.
      f-labinda = erreur.libel.

      FIND erreur WHERE erreur.noerr = 101030
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      ASSIGN f-labind = erreur.libel
             Lst-lang1 = f-labind + lst-lang1.
      langue:ADD-FIRST(f-labind).

   END.

   RUN get-couleur.p ("01",ENTRY(1,get-cookie("CliId")),OUTPUT wcoul-coli). 
   RUN get-couleur.p ("02",ENTRY(1,get-cookie("CliId")),OUTPUT wcoul-colp).

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE outputHeader w-html 
PROCEDURE outputHeader :
/*------------------------------------------------------------------------
  Purpose:     Output the MIME header, and any "cookie" information needed 
               by this procedure.  
  Parameters:  <none>
  Notes:       In the event that this Web object is state-aware, this is 
               a good place to set the WebState and WebTimeout attributes.
------------------------------------------------------------------------*/
  /* To make this a state-aware Web object, pass in the timeout period
   * (in minutes) before running outputContentType.  If you supply a 
   * timeout period greater than 0, the Web object becomes state-aware 
   * and the following happens:
   *
   *   - 4GL variables webState and webTimeout are set
   *   - a cookie is created for the broker to id the client on the return trip
   *   - a cookie is created to id the correct procedure on the return trip
   *
   * If you supply a timeout period less than 1, the following happens:
   *
   *   - 4GL variables webState and webTimeout are set to an empty string
   *   - a cookie is killed for the broker to id the client on the return trip
   *   - a cookie is killed to id the correct procedure on the return trip
   *
   * For example, set the timeout period to 5 minutes.
   *
   *   setWebState (5.0).
   */
    
  /* Output additional cookie information here before running outputContentType.
   *   For more information about the Netscape Cookie Specification, see
   *   http://home.netscape.com/newsref/std/cookie_spec.html  
   *   
   *   Name         - name of the cookie
   *   Value        - value of the cookie
   *   Expires date - Date to expire (optional). See TODAY function.
   *   Expires time - Time to expire (optional). See TIME function.
   *   Path         - Override default URL path (optional)
   *   Domain       - Override default domain (optional)
   *   Secure       - "secure" or unknown (optional)
   * 
   *   The following example sets custNum=23 and expires tomorrow at (about)
   *   the same time but only for secure (https) connections.
   *      
   *   RUN SetCookie IN web-utilities-hdl 
   *     ("custNum":U, "23":U, TODAY + 1, TIME, ?, ?, "secure":U).
   */ 
  output-content-type ("text/html":U).
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ouvrir_query w-html 
PROCEDURE ouvrir_query :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/
 DEF VAR que-taction   AS   CHARACTER         NO-UNDO.
 DEF VAR que-marque    AS   CHARACTER         NO-UNDO.
 DEF VAR que-cahier    AS   CHARACTER         NO-UNDO.
 DEF VAR que-type      AS   CHARACTER         NO-UNDO.
 DEF VAR que-rec       AS   CHARACTER         NO-UNDO.
 DEF VAR que-lang      AS   CHARACTER         NO-UNDO.
 DEF VAR que-stat      AS   CHARACTER         NO-UNDO.
 DEF VAR que-web       AS   CHARACTER         NO-UNDO.
 DEF VAR que-typlib    AS   CHARACTER         NO-UNDO.
 
DO WITH FRAME {&FRAME-NAME}:
   
/*                                                                               */
/*     IF buf-nocli <> 0 THEN DO:                                                */
/*                                                                               */
/*        FIND adrd WHERE adrd.nosoc = 1                                         */
/*                    AND adrd.noadr = buf-nocli                                 */
/*                    AND adrd.csmt  = 0 NO-LOCK NO-ERROR.                       */
/*                                                                               */
/*        FIND parmt WHERE parmt.nompar = "WEB-LIBRAIRE"                         */
/*                     AND parmt.nomuti = ""                                     */
/*                     AND parmt.nosoc  = 0 NO-LOCK NO-ERROR.                    */
/*                                                                               */
/*        IF AVAILABLE parmt AND CAN-DO(parmt.valpar,adrd.typc) THEN DO:         */
/*                                                                               */
/*           FIND parmt WHERE parmt.nompar = "WEB-LIBRAIRE-ARTICLE"              */
/*                        AND parmt.nomuti = ""                                  */
/*                        AND parmt.nosoc  = 0 NO-LOCK NO-ERROR.                 */
/*           IF AVAILABLE parmt THEN                                             */
/*              que-typlib = " AND CAN-DO(~"" + parmt.valpar + "~",arti.type)".  */
/*        END.                                                                   */
/*     END.                                                                      */
/*                                                                               */
    que-lang = IF lib-lang = "" THEN ""
               ELSE " AND arti.ref BEGINS ~"" + lib-lang + "~"".

    que-type = IF lib-type = "x" OR lib-type = "" THEN ""
               ELSE " AND arti.typeweb = ~"" + lib-type + "~"".

    que-rec  = IF lib-rec = "" THEN ""
               ELSE " AND arti.webliB CONTAINS ~"" + lib-rec + "~"".
    
    que-stat  = IF lib-stat = "" THEN ""
               ELSE " AND arti.stat1 = ~"" + lib-stat + "~"".

    que-web   = IF flag-tous THEN ""
                ELSE " AND arti.pubweb = true".
    
    {&out} "FOR EACH arti WHERE arti.nosoc = 1" + que-web
                     + que-lang + que-type + que-rec + que-stat + que-typlib
                     + " NO-LOCK INDEXED-REPOSITION"


    qh:SET-BUFFERS(BUFFER arti:HANDLE).
    qh:QUERY-PREPARE("FOR EACH arti WHERE arti.nosoc = 1" + que-web
                     + que-lang + que-type + que-rec + que-stat + que-typlib
                     + " NO-LOCK INDEXED-REPOSITION").
    qh:QUERY-OPEN.

 END.
 
 qh:GET-FIRST(NO-LOCK).
 f-rowid = IF AVAILABLE arti THEN ROWID(arti) ELSE ?.
 qh:GET-LAST(NO-LOCK).
 l-rowid = IF AVAILABLE arti THEN ROWID(arti) ELSE ?.

 qh:GET-FIRST(NO-LOCK).
 IF NOT AVAILABLE arti THEN DO:
    IF que-rec <> "" THEN que-rec = REPLACE(que-rec,"&","!").

    qh:QUERY-PREPARE("FOR EACH arti WHERE arti.nosoc = 1" + que-web
                     + que-lang + que-type + que-rec + que-stat + que-typlib
                     + " NO-LOCK INDEXED-REPOSITION").
    qh:QUERY-OPEN.

 END.

 qh:GET-LAST(NO-LOCK).
 nb-record = qh:NUM-RESULTS.

 END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE process-web-request w-html 
PROCEDURE process-web-request :
/*------------------------------------------------------------------------
  Purpose:     Process the web request.
  Notes:       
------------------------------------------------------------------------*/
    
  /* STEP 0 -
   * Output the MIME header and set up the object as state-less or state-aware. 
   * This is required if any HTML is to be returned to the browser. 
   *
   * NOTE: Move 'RUN outputHeader.' to the GET section below if you are going
   * to simulate another Web request by running a Web Object from this
   * procedure.  Running outputHeader precludes setting any additional cookie
   * information.
   */ 
   

/*   RUN outputHeader.  */

  CREATE QUERY qh.

  RUN initialisation.

  IF get-cookie("SessionId") <> "" THEN DO: 
     buf-nocli  = INTEGER(ENTRY(1,get-cookie("SessionId"))).
     flag-tous  = NUM-ENTRIES(get-cookie("SessionId")) >= 4 AND
                  ENTRY(4,get-cookie("SessionId")) = "TEL".
  END.

  IF buf-nocli <> 0 THEN DO:

     FIND adrd WHERE adrd.nosoc = 1
                 AND adrd.noadr = buf-nocli
                 AND adrd.csmt  = 0 NO-LOCK NO-ERROR.

     FIND parmt WHERE parmt.nompar = "WEB-LIBRAIRE"
                  AND parmt.nomuti = ""
                  AND parmt.nosoc  = 0 NO-LOCK NO-ERROR.

     flag-libraire = AVAILABLE parmt AND CAN-DO(parmt.valpar,adrd.typc).

     FIND parmt WHERE parmt.nompar = "WEB-LIBRAIRE-ARTICLE"
                  AND parmt.nomuti = ""
                  AND parmt.nosoc  = 0 NO-LOCK NO-ERROR.
     lst-hors = IF AVAILABLE parmt THEN parmt.valpar ELSE "".
  END.

  /* Describe whether to receive FORM input for all the fields.  For example,
   * check particular input fields (using GetField in web-utilities-hdl). 
   * Here we look at REQUEST_METHOD. 
   */
  IF REQUEST_METHOD = "POST":U THEN DO:
    /* STEP 1 -
     * Copy HTML input field values to the Progress form buffer. */
    RUN inputFields.
        /* STEP 2 -
     * Open the database or SDO query and and fetch the first record. */ 
    RUN findRecords.
    
    /* STEP 3 -    
     * AssignFields will save the data in the frame.
     * (it automatically upgrades the lock to exclusive while doing the update)
     * 
     *  If a new record needs to be created set AddMode to true before 
        running assignFields.  
     *     setAddMode(TRUE).   
     * RUN assignFields. */
    
    /* STEP 4 -
     * Decide what HTML to return to the user. Choose STEP 4.1 to simulate
     * another Web request -OR- STEP 4.2 to return the original form (the
     * default action).
     *
     * STEP 4.1 -
     * To simulate another Web request, change the REQUEST_METHOD to GET
     * and RUN the Web object here.  For example,
     *
     *  ASSIGN REQUEST_METHOD = "GET":U.
     *  RUN run-web-object IN web-utilities-hdl ("myobject.w":U).
     */
     
    /* STEP 4.2 -
     * To return the form again, set data values, display them, and output 
     * them to the WEB stream.  
     *
     * STEP 4.2a -
     * Set any values that need to be set, then display them. */
    RUN displayFields.
   
    /* STEP 4.2b -
     * Enable objects that should be enabled. */
    RUN enableFields.

    DO i = 1 TO NUM-ENTRIES(lib-rec," "):
       IF TRIM(ENTRY(i,lib-rec)) = "" THEN NEXT.
       ASSIGN j = j + 1
             tab-lib[j] = TRIM(ENTRY(i,lib-rec)).
    END.
    
    crit:SCREEN-VALUE IN FRAME {&FRAME-NAME}   = get-field("lib").
    tprod:SCREEN-VALUE IN FRAME {&FRAME-NAME}  = get-field("tprod").
    langue:SCREEN-VALUE IN FRAME {&FRAME-NAME} = get-field("langue").
    statq:SCREEN-VALUE = get-field("statq").

    f-labtous = IF   get-field("tprod") = f-labtousf THEN f-labtousf
                ELSE                                      f-labtousa.

    lib-type = ENTRY(LOOKUP(get-field("tprod"),Lst-Prod1,"#"),lst-Prod2,"#").
    lib-lang = ENTRY(LOOKUP(get-field("langue"),Lst-lang1),lst-lang2).
    lib-rec  = get-field("lib").
    lib-stat = statq:SCREEN-VALUE.
    action   = get-field("navigue").

    LRowid:SCREEN-VALUE  = get-field("LRowid").
    FRowid:SCREEN-VALUE  = get-field("FRowid").
    LstProd:SCREEN-VALUE = Lst-Prod1.
    LstTypex:SCREEN-VALUE = Lst-Prod2.
    alang:SCREEN-VALUE = STRING(a-lang).


    RUN decode_ligne.p (INPUT a-lang,INPUT-OUTPUT lib-rec).
        
    RUN ouvrir_query.

    contenu-ligne = "".

    FIND erreur WHERE erreur.noerr = 100019
                  AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
    DO i = 1 to NUM-ENTRIES(erreur.libel):
       lab-bouton[i] = ENTRY(i,erreur.libel).
    END.
    
    IF action <> lab-bouton[1] AND
       action <> lab-bouton[2] AND
       action <> lab-bouton[3] AND
       action <> lab-bouton[4] AND
       action <> lab-bouton[5] THEN action = lab-bouton[1].

    IF action = lab-bouton[5] THEN action = lab-bouton[1].

    /* reposition du QUERY pour la page précédente
       et la page suivante                          */

    CASE action:
        WHEN lab-bouton[3] THEN DO:
            qh:REPOSITION-TO-ROWID(TO-ROWID(get-field("LRowid"))).
            qh:GET-NEXT(NO-LOCK).
        END.
        WHEN lab-bouton[2] THEN qh:REPOSITION-TO-ROWID(TO-ROWID(get-field("FRowid"))).            
    END CASE.

    IF action = lab-bouton[2] OR 
       action = lab-bouton[4] THEN DO:
       IF action = lab-bouton[2] THEN qh:GET-PREV(NO-LOCK).
       ELSE qh:GET-LAST(NO-LOCK).
       REPEAT i = 9 TO 0 BY -1:
           IF NOT AVAILABLE arti THEN LEAVE.
           IF i = 9 THEN LRowid:SCREEN-VALUE = STRING(ROWID(arti)).
           contenu-ligne[i + 1] = charge_ligne().
           lien-ligne[i + 1]    = arti.ref.
           IF ROWID(arti) = f-rowid THEN SUBSTRING(lst-etat,1,2) = "NN".
           IF ROWID(arti) = l-rowid THEN SUBSTRING(lst-etat,3,2) = "NN".
           FRowid:SCREEN-VALUE = STRING(ROWID(arti)).
           qh:GET-PREV(NO-LOCK).
       END.
       IF action = lab-bouton[2] AND i > 0 THEN action = lab-bouton[1].
    END. 
    
    IF action = lab-bouton[3] OR 
       action = lab-bouton[1] THEN DO:
       IF action = lab-bouton[3] THEN DO:
          qh:GET-NEXT(NO-LOCK).
          IF NOT AVAILABLE arti THEN DO:
             qh:REPOSITION-TO-ROWID(TO-ROWID(get-field("FRowid"))).
             qh:GET-NEXT(NO-LOCK).
          END.
       END.
       ELSE qh:GET-FIRST(NO-LOCK).
       REPEAT i = 0 TO 9:
           IF NOT AVAILABLE arti THEN LEAVE.
           IF i = 0 THEN FRowid:SCREEN-VALUE = STRING(ROWID(arti)).
           contenu-ligne[i + 1] = charge_ligne().
           lien-ligne[i + 1]    = arti.ref.
           IF ROWID(arti) = f-rowid THEN SUBSTRING(lst-etat,1,2) = "NN".
           IF ROWID(arti) = l-rowid THEN SUBSTRING(lst-etat,3,2) = "NN".
           LRowid:SCREEN-VALUE = STRING(ROWID(arti)).
           qh:GET-NEXT(NO-LOCK).
       END.
    END.

    RUN SetCookie IN web-utilities-hdl ("InterNou",FRowid:SCREEN-VALUE + ","
                                        + crit:SCREEN-VALUE    + ","
                                        + tprod:SCREEN-VALUE   + ","
                                        + lib-lang             + ","
                                        + statq:SCREEN-VALUE
                                        ,?,?,?,?,?).

    RUN outputHeader.
    
    /*{&out} " Nombre:" nb-record.*/

    /* STEP 4.2c -
     * OUTPUT the Progress form buffer to the WEB stream. */
    RUN outputFields.
    
  END. /* Form has been submitted. */
 
  /* REQUEST-METHOD = GET */ 
  ELSE DO:
  
    /* This is the first time that the form has been called. Just return the
     * form.  Move 'RUN outputHeader.' here if you are going to simulate
     * another Web request. */ 

/*       RUN outputHeader.  */

    /* STEP 1 -
     * Open the database or SDO query and and fetch the first record. */ 
    RUN findRecords.
    
    /* Return the form again. Set data values, display them, and output them
     * to the WEB stream.  
     *
     * STEP 2a -
     * Set any values that need to be set, then display them. */
    RUN displayFields.

    /* STEP 2b -
     * Enable objects that should be enabled. */
    RUN enableFields.

    IF get-field("lib") <> "" THEN DO:
       crit:SCREEN-VALUE   IN FRAME {&FRAME-NAME} = get-field("lib").
       lib-rec  = crit:SCREEN-VALUE IN FRAME {&FRAME-NAME}.

       langue:SCREEN-VALUE IN FRAME {&FRAME-NAME} = get-field("langue").
       IF      get-field("langue") = "1" THEN langue:SCREEN-VALUE = langue:ENTRY(2).
       ELSE IF get-field("langue") = "2" THEN langue:SCREEN-VALUE = langue:ENTRY(3).
       ELSE                                   langue:SCREEN-VALUE = langue:ENTRY(1).
       lib-lang = ENTRY(langue:LOOKUP(langue:SCREEN-VALUE),lst-lang2).

       IF get-field("tprod") = "" THEN tprod:SCREEN-VALUE  = f-labtous.
       ELSE tprod:SCREEN-VALUE = tprod:ENTRY(LOOKUP(get-field("tprod"),lst-prod2,"#")).
       lib-type = ENTRY(tprod:LOOKUP(tprod:SCREEN-VALUE),lst-Prod2,"#").
       lib-stat = get-field("statq").
       action = "cahier".
    END.
    ELSE IF ENTRY(1,get-cookie("InterNou")) = "" or
            ENTRY(1,get-cookie("InterNou")) = "?" THEN DO:
       crit:SCREEN-VALUE   IN FRAME {&FRAME-NAME} = "".
       tprod:SCREEN-VALUE  IN FRAME {&FRAME-NAME} = f-labtous.
       langue:SCREEN-VALUE = langue:ENTRY(a-lang + 1).

       statq:SCREEN-VALUE = IF get-field("statq") = "" THEN "N" ELSE get-field("statq"). 
       lib-type = "".
       lib-lang = ENTRY(a-lang + 1,lst-lang2).
       lib-stat = statq:SCREEN-VALUE.
       action   = "cahier".
       
                OUTPUT TO "/user/wrk/thesis.log" APPEND.
                PUT "SessionId : " get-cookie("InterNou") SKIP.
                PUT "-------------------------------------" SKIP.
                OUTPUT CLOSE.       
    END.
    ELSE DO:
       crit:SCREEN-VALUE IN FRAME {&FRAME-NAME}  = ENTRY(2,get-cookie("InterNou")).

       IF f-labtousa BEGINS ENTRY(3,get-cookie("InterNou")) OR
          f-labtousf BEGINS ENTRY(3,get-cookie("InterNou")) THEN DO:
          IF a-lang = 1 THEN tprod:SCREEN-VALUE = f-labtousa.
          ELSE               tprod:SCREEN-VALUE = f-labtousf.
       END.
       ELSE DO i = 1 TO NUM-ENTRIES(tprod:LIST-ITEMS):
               IF tprod:ENTRY(i) BEGINS ENTRY(3,get-cookie("InterNou")) 
               THEN DO:
                   tprod:SCREEN-VALUE = tprod:ENTRY(i).
                   LEAVE.
               END.
       END.

       action = "pos".
       lib-rec  = crit:SCREEN-VALUE IN FRAME {&FRAME-NAME}.

       tprod:SCREEN-VALUE  = ENTRY(3,get-cookie("InterNou")).
       lib-type = ENTRY(LOOKUP(tprod:SCREEN-VALUE,Lst-Prod1,"#"),lst-Prod2,"#").
       lib-lang = ENTRY(4,get-cookie("InterNou")).
       lib-stat = ENTRY(5,get-cookie("InterNou")).
       langue:SCREEN-VALUE = langue:ENTRY(LOOKUP(lib-lang,Lst-lang2)).
       FRowid:SCREEN-VALUE  = ENTRY(1,get-cookie("InterNou")).
       LRowid:SCREEN-VALUE  = ?.

    END.

    LstProd:SCREEN-VALUE = Lst-Prod1.
    LstTypex:SCREEN-VALUE = Lst-Prod2.
    alang:SCREEN-VALUE = STRING(a-lang).

    RUN decode_ligne.p (INPUT a-lang,INPUT-OUTPUT lib-rec).

    RUN ouvrir_query.

    contenu-ligne = "".
    
    IF action <> "" THEN DO:

       IF action = "cahier" THEN do:
           qh:GET-FIRST(NO-LOCK).
           FRowid:SCREEN-VALUE = STRING(ROWID(arti)).

           RUN SetCookie IN web-utilities-hdl
               ("InterNou",FRowid:SCREEN-VALUE  + ","
                         + crit:SCREEN-VALUE    + ","
                         + tprod:SCREEN-VALUE   + ","
                         + lib-lang             + ","
                         + lib-stat
                         ,?,?,?,?,?).
       END.
          
       /* reposition du QUERY pour la page précédente
             et la page suivante                          */

       qh:REPOSITION-TO-ROWID(TO-ROWID(FRowid:SCREEN-VALUE)).
       
       qh:GET-NEXT(NO-LOCK).
       REPEAT i = 0 TO 9:
          IF NOT AVAILABLE arti THEN LEAVE.
          IF i = 0 THEN FRowid:SCREEN-VALUE = STRING(ROWID(arti)).
          contenu-ligne[i + 1] = charge_ligne().
          lien-ligne[i + 1]    = arti.ref.
          IF ROWID(arti) = f-rowid THEN SUBSTRING(lst-etat,1,2) = "NN".
          IF ROWID(arti) = l-rowid THEN SUBSTRING(lst-etat,3,2) = "NN".
          LRowid:SCREEN-VALUE = STRING(ROWID(arti)).
          qh:GET-NEXT(NO-LOCK).
       END.

    END.

    RUN outputHeader.

    /* STEP 2c -
     * OUTPUT the Progress from buffer to the WEB stream. */
    RUN outputFields.
  END. 
  
  /* Show error messages. */
  IF AnyMessage() THEN 
  DO:
     /* ShowDataMessage may return a Progress column name. This means you
      * can use the function as a parameter to HTMLSetFocus instead of 
      * calling it directly.  The first parameter is the form name.   
      *
      * HTMLSetFocus("document.DetailForm",ShowDataMessages()). */
     ShowDataMessages().
  END.
 
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE remplace_tag w-html 
PROCEDURE remplace_tag :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

DEF INPUT        PARAMETER ancre    AS   CHARACTER        NO-UNDO.       
DEF INPUT        PARAMETER nombre   AS   INTEGER          NO-UNDO.       
DEF INPUT        PARAMETER tag      AS   CHARACTER        NO-UNDO.       
DEF INPUT        PARAMETER texte    AS   CHARACTER        NO-UNDO.       
DEF INPUT-OUTPUT PARAMETER ligne    AS   CHARACTER        NO-UNDO.

DEF VAR i          AS   INTEGER                    NO-UNDO.

DO i = 1 TO nombre:
   IF INDEX(tag,ancre + STRING(i,"99")) <> 0 THEN ligne = REPLACE(ligne,tag,ENTRY(i,texte,"#")).
END.

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

/* ************************  Function Implementations ***************** */

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION charge_ligne w-html 
FUNCTION charge_ligne RETURNS CHARACTER
  ( /* parameter-definitions */ ) :
/*------------------------------------------------------------------------------
  Purpose:  
    Notes:  
------------------------------------------------------------------------------*/

DEF VAR buf-ref      AS CHARACTER                              NO-UNDO.
DEF VAR buf-prixchf  AS CHARACTER                              NO-UNDO.
DEF VAR buf-prixeur  AS CHARACTER                              NO-UNDO.
DEF VAR buf-prbachf  AS CHARACTER                              NO-UNDO.
DEF VAR buf-prbaeur  AS CHARACTER                              NO-UNDO.
DEF VAR buf-logo     AS CHARACTER                              NO-UNDO.
DEF VAR buf-action   AS CHARACTER INIT "/images/commun/action" NO-UNDO.
DEF VAR buf-caddy    AS CHARACTER INIT "/img/caddie"       NO-UNDO.
DEF VAR buf-new      AS CHARACTER INIT "/images/commun/new"    NO-UNDO.
DEF VAR buf-serie    AS CHARACTER INIT "/images/commun/serie"  NO-UNDO.

DEF VAR buf-nomimage AS CHARACTER                              NO-UNDO.
DEF VAR buf-titre    AS CHARACTER                              NO-UNDO.

IF a-lang = 1 THEN ASSIGN buf-action = buf-action + "_a.gif"
                          buf-caddy  = buf-caddy  +   ".png"
                          buf-new    = buf-new    + "_a.gif"
                          buf-serie  = buf-serie  + "_a.gif".
ELSE ASSIGN buf-action = buf-action + "_f.gif" 
            buf-caddy  = buf-caddy  +   ".png" 
            buf-new    = buf-new    + "_f.gif" 
            buf-serie  = buf-serie  + "_f.gif".


IF a-lang = 1 THEN buf-caddy  = "<a href=~"/de/warenkorb/?retour=/de/buchhandlung&amp;lang=" + STRING(a-lang)
                              + "&amp;id=" + arti.ref + "~"><img border=~"0~" src=~"" + buf-caddy
                              + "~" alt=~"" + arti.titre + "~" title=~"" + arti.titre + "~" /></a>".
ELSE buf-caddy  = "<a href=~"/fr/panier?retour=/fr/librairie&amp;lang=" + STRING(a-lang)
                + "&amp;id=" + arti.ref + "~"><img border=~"0~" src=~"" + buf-caddy
                + "~" alt=~"" + arti.titre + "~" title=~"" + arti.titre + "~" /></a>".

/* buf-caddy  = "<a href=~"/?q=node/5&amp;retour=article&amp;lang=" + STRING(a-lang)   */
/*            + "&amp;id=" + arti.ref + "~"><img border=~"0~" src=~"" + buf-caddy  */
/*            + "~"></a>".                                                     */

IF INDEX("SRE",arti.stat1) <> 0 THEN buf-caddy = "".
IF flag-libraire AND NOT CAN-DO(lst-hors,arti.TYPE) THEN buf-caddy = "".

/* IF arti.stat2 <> "a" OR arti.stat1 <> "" THEN buf-action = "".  */
/* IF arti.stat1 <> "n"                     THEN buf-new    = "".  */
/* IF arti.stat1 <> "j"                     THEN buf-serie  = "".  */

/* IF arti.stat1 = "n" AND TODAY - arti.datcre > 30 THEN buf-new = "".  */

/* buf-logo = IF buf-action <> "" THEN "<img border=~"0~" src=~"" + buf-action + "~">" ELSE ""   */
/*          + IF buf-new    <> "" THEN "<img border=~"0~" src=~"" + buf-new    + "~">" ELSE ""   */
/*          + IF buf-serie  <> "" THEN "<img border=~"0~" src=~"" + buf-serie  + "~">" ELSE "".  */


CASE SUBSTRING(LC(arti.ref),1,1):
    WHEN "F" THEN buf-nomimage = "images_e/f/" + LC(arti.ref) + ".jpg".
    WHEN "D" THEN buf-nomimage = "images_e/d/" + LC(arti.ref) + ".jpg".
    OTHERWISE     buf-nomimage = "images_e/a/" + LC(arti.ref) + ".jpg".
END CASE.

buf-ref = IF SEARCH(buf-nomimage) <> ? THEN 
             "<img src=~"/" + buf-nomimage + "~" border=~"0~" alt=~"" + arti.titre + "~" title=~"" + arti.titre + "~" /></a>"
          ELSE IF arti.ref BEGINS "D" THEN
               "<img src=~"/images_e/pasdispo_d.jpg~" border=~"0~" alt=~"" + arti.titre + "~" title=~"" + arti.titre + "~" /></a>"
          ELSE "<img src=~"/images_e/pasdispo_f.jpg~" border=~"0~" alt=~"" + arti.titre + "~" title=~"" + arti.titre + "~" /></a>".

IF a-lang = 1 THEN DO:
   buf-ref   = "<a href=~"/de/artikel?lang=" + STRING(a-lang) + "&amp;id=" + arti.ref + "~">" + buf-ref.
   buf-titre = "<a href=~"/de/artikel?lang=" + STRING(a-lang) + "&amp;id=" + arti.ref + "~">" + arti.titre + "</a>".
END.
ELSE DO:
   buf-ref   = "<a href=~"/fr/article?lang=" + STRING(a-lang) + "&amp;id=" + arti.ref + "~">" + buf-ref.
   buf-titre = "<a href=~"/fr/article?lang=" + STRING(a-lang) + "&amp;id=" + arti.ref + "~">" + arti.titre + "</a>".
END.

/* buf-ref = "<a href=~"/?q=node/4&amp;lang=" + STRING(a-lang) + "&amp;id=" + arti.ref + "~">" + buf-ref.                */
/* buf-titre = "<a href=~"/?q=node/4&amp;lang=" + STRING(a-lang) + "&amp;id=" + arti.ref + "~">" + arti.titre + "</a>".  */
/*                                                                                                               */

/*
buf-ref = "<a href=~"tbr_fiche.w?lang=" + STRING(a-lang) + "&amp;id=" + arti.ref + "~">" + buf-ref.
buf-titre = "<a href=~"tbr_fiche.w?lang=" + STRING(a-lang) + "&amp;id=" + arti.ref + "~">" + arti.titre + "</a>".
*/

FIND LAST apri WHERE apri.nosoc   = arti.nosoc  AND
                     apri.typr    = TRUE        AND
                     apri.ref     = arti.ref    AND
                     apri.noadr   = 0           AND
                     apri.csmt    = 0           AND
                     apri.codmon  = "EUR"       AND
                     apri.noprix  = 1           AND
                     apri.datfin >= TODAY       NO-LOCK NO-ERROR.

IF AVAILABLE apri THEN buf-prixeur = STRING(apri.prix,"EUR -zzzz9.99").

FIND LAST apri WHERE apri.nosoc   = arti.nosoc  AND
                     apri.typr    = TRUE        AND
                     apri.ref     = arti.ref    AND
                     apri.noadr   = 0           AND
                     apri.csmt    = 0           AND
                     apri.codmon  = "CHF"       AND
                     apri.noprix  = 1           AND
                     apri.datfin >= TODAY       NO-LOCK NO-ERROR.

IF AVAILABLE apri THEN buf-prixchf = STRING(apri.prix,"CHF -zzzz9.99").

FIND LAST apri WHERE apri.nosoc   = arti.nosoc  AND
                     apri.typr    = TRUE        AND
                     apri.ref     = arti.ref    AND
                     apri.noadr   = 0           AND
                     apri.csmt    = 0           AND
                     apri.codmon  = "EUR"       AND
                     apri.noprix  = 9           AND
                     apri.datfin >= TODAY       NO-LOCK NO-ERROR.
IF AVAILABLE apri THEN buf-prbaeur = STRING(apri.prix,"EUR -zzzz9.99").

FIND LAST apri WHERE apri.nosoc   = arti.nosoc  AND
                     apri.typr    = TRUE        AND
                     apri.ref     = arti.ref    AND
                     apri.noadr   = 0           AND
                     apri.csmt    = 0           AND
                     apri.codmon  = "CHF"       AND
                     apri.noprix  = 9           AND
                     apri.datfin >= TODAY       NO-LOCK NO-ERROR.

IF AVAILABLE apri THEN buf-prbachf = STRING(apri.prix,"CHF -zzzz9.99").
RETURN buf-ref     + "#" + buf-titre  + "#" + arti.stitre  + "#"
     + arti.auteur + "#" + ENTRY(1,arti.DESCRIPTION,CHR(10)) + "#"
     + buf-prixchf + "#" + buf-prixeur  + "#" + buf-prbachf  + "#"
     + buf-prbaeur + "#" + buf-caddy.

END FUNCTION.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

